﻿@using System.Configuration
@using System.Data.SqlClient
@{
    Layout = "~/_SiteLayout.cshtml";
    Page.Title = "Export History Page";

    bool hasError = false;
    string errorMessage = string.Empty;
    bool hasSuccess = false;
    string successMessage = string.Empty;

    List<KeppelLand.Entities.ReportingPeriodHistory> reportingPeriodList = null;

    if (IsPost)
    {
        if (Request.Form["actionButton"] == "someaction")
        {

        } // if (Request.Form["actionButton"] == "someaction")

    } // if (IsPost)

    reportingPeriodList = KeppelLand.Controllers.ReportingPeriodController.GetReportingPeriodHistory();
}

@if (!KeppelLand.Helpers.UserIdentityHelper.IsTrainer())
{
    @RenderPage("~/Shared/Access_Control.cshtml");
                                                 return;
}

<div class="container-fluid main-content" role="main">

    @RenderPage("~/Shared/Help_Tab.cshtml")

    @if (hasError)
    {
        <div class="alert alert-danger alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            @Html.Raw(errorMessage)
        </div>
    }
    @if (hasSuccess)
    {
        <div class="alert alert-success alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            @successMessage
        </div>
    }

    <form method="post" class="hidden-print">
        <h2>Export History</h2>
    </form>

    @RenderPage("~/Shared/Export_History.cshtml", reportingPeriodList)

    <form method="post" id="approval_form">
        <input type="hidden" name="actionButton" id="actionButton" />
        <input type="hidden" name="actionId" id="actionId" />
    </form>

    <p>&nbsp;</p>

</div>

@RenderPage("~/Shared/Standard_Modals.cshtml")

<div class="modal fade" id="messageModal" tabindex="-1" role="dialog" aria-labelledby="messageModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="messageModalLabel">Message</h4>
            </div>
            <div class="modal-body" id="messageModalBody">
                <p>
                    <strong>Rejection Reason:</strong>
                </p>
                <p id="messageModal_rejected_reason">
                    Click OK to proceed with this action.<br />
                    Click Canel to abort this action.
                </p>

                <p>
                    <strong>Rejected By</strong><br />
                    <span id="messageModal_rejected_by"></span>
                </p>
                <p>
                    <strong>Rejected Date</strong><br />
                    <span id="messageModal_rejected_date"></span>
                </p>
            </div>

            <div class="modal-footer">

                <button type="button" class="btn btn-primary" id="messageModal_OK" data-dismiss="modal">OK</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="helpModalLabel">Help <small>(Add New Claim)</small></h4>
            </div>
            <div class="modal-body">
                <p>
                    Use this page to submit, add new or edit existing claims.<br />
                    To add claims, follow the below instructions.
                </p>

                <div class="panel panel-default">
                    <div class="panel-heading">Instructions to add new claim</div>
                    <div class="panel-body">
                        <ol>
                            <li>Enter claim date, official hours and overtime hours. These are required fields.</li>
                            <li>
                                Fill in overtime hours if applicable.<br />
                                This is required if you intend to claim OT or meal allowances.
                            </li>
                        </ol>
                    </div>
                </div>

                <p>To edit claims, follow the below instructions.</p>

                <div class="panel panel-default">
                    <div class="panel-heading">Instructions to edit existings claim(s)</div>
                    <div class="panel-body">

                        <ol>
                            <li>Claimant to enter claim date, official hours and overtime hours.</li>
                            <li>Claimant then fill in the overtime type.</li>
                        </ol>
                    </div>
                </div>

                <p>To submit claims, follow the below instructions.</p>

                <div class="panel panel-default">
                    <div class="panel-heading">Instructions to submit claims to supervisor</div>
                    <div class="panel-body">

                        <ol>
                            <li>Claimant to enter claim date, official hours and overtime hours.</li>
                            <li>Claimant then fill in the overtime type.</li>
                        </ol>
                    </div>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="helpModal_Close" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

@section Scripts
{
    <script type="text/javascript" src="~/Scripts/kendo/2014.3.1119/kendo.ui.core.min.js"></script>
    <script type="text/javascript" src="~/Scripts/moment.js"></script>
    <script type="text/javascript" src="~/Scripts/moment-with-locales.js"></script>
    <script type="text/javascript">
    (function ($) {
        "use strict";
        $(document).ready(function () {
        });
    }(jQuery));
    </script>
}